//
// Created by Win on 2016/7/14.
//

#ifndef APM_R3_HTTP_RMI_H
#define APM_R3_HTTP_RMI_H

#include "frrmi_basetype.h"

int skipCustomData(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
                   , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
                   , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

char* readUTF(Frbyte_Packet *p_st_data);

int readStreamHeader(Frbyte_Packet *p_st_data);

int rmi_report(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
               , int *p_i_deep, rmiDataParent *p_rmi_head, rmiDataParent **pp_rmi_root
               , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readObject(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request, int *p_i_deep, char *p_prefix);

int readObject0(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
                , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
                , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readNull(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
             , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
             , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readHandle(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
               , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
               , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readTypeString(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
                   , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
                   , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readClass(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
              , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
              , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readClassDesc(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
                  , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
                  , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readBlockHeader(Frbyte_Packet *p_st_data);
int readBlockHeader(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
        , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
        , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readProxyDesc(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
                  , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
                  , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readClassDescriptor(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
                        , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
                        , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readNonProxyDesc(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
                     , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
                     , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readString(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
               , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
               , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readArray(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
              , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
              , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readEnum(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
             , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
             , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int readOrdinaryObject(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
                       , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
                       , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);

int yongyou_readObject0(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request
        , int *p_i_deep, rmiDataParent **pp_rmi_head, rmiDataParent **pp_rmi_root
        , uint32_t *p_u32_passHandle, char *p_parent, char *p_prefix);
/*!
 * \brief RMI 解析主函数
 *
 *
 * */
int readRmi(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request, char *p_prefix);

int yongyou_readObject(Frbyte_Packet *p_st_data, Frreport_body_data *p_st_body_data, int i_use_request, int *p_i_deep, char *p_prefix);

#endif //APM_R3_HTTP_RMI_H
